﻿namespace FadeLang.Ast
{
    internal static class OpTypeConverter
    {
        public static OpType Parse(string op) {
            switch (op) {
                case "+":
                    return OpType.Add;
                case "-":
                    return OpType.Minus;
                case "*":
                    return OpType.Mul;
                case "/":
                    return OpType.Div;
                case "%":
                    return OpType.Mod;
                case ">":
                    return OpType.GreaterThan;
                case ">=":
                    return OpType.GreaterThanEquals;
                case "<":
                    return OpType.LessThan;
                case "<=":
                    return OpType.LessThanEquals;
                case "==":
                    return OpType.Equals;
                case "!=":
                    return OpType.NotEquals;
                case "and":
                    return OpType.And;
                case "or":
                    return OpType.Or;
                default:
                    return OpType.Null;
            }
        }
    }
}